package main

import (
	"github.com/gin-gonic/gin"
	"sola/common"
	"sola/db"
	"sola/router"
	"sola/session"
)

func initSession() (err error) {
	return session.Init("memory", "")
}

func setupRouter() *gin.Engine {
	r := gin.Default()
	r.MaxMultipartMemory = 2 * (8 << 20) // 16 MiB
	//r.StaticFile("/", "./public/index.html")
	r.Static("/images/", common.BaseUploadFilePath)
	router.InitRouter(r)
	return r
}
func main() {
	initSession()
	db.InitDB()
	r := setupRouter()
	//r.Run("10.0.2.30:8000")
	r.Run(":8000")
}
